package com.example.blogsystemssm.service;

import com.example.blogsystemssm.mapper.ArticleMapper;
import com.example.blogsystemssm.model.ArticleInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.sql.Date;
import java.util.List;

@Service
public class ArticleService {
    @Autowired
    private ArticleMapper articleMapper;

    public List<ArticleInfo> getList(Integer uid) {
        return articleMapper.getList(uid);
    }

    public ArticleInfo getDetail(Integer aid) {
        return articleMapper.getDetail(aid);
    }

    public int delArt(Integer aid, Integer uid) {
        return articleMapper.delArt(aid, uid);
    }

    public ArticleInfo updateContent
            (String aid, String content, String title, Date updatetime, Integer uid) {
        return articleMapper.updateContent(title, aid, content, updatetime, uid);
    }

    public Integer getCount(Integer uid) {
        return articleMapper.getCount(uid);
    }
}